//debugger

if ((! (typeof (_USERSETTINGS_CLIENT) == "object")) || (! (typeof (_USERSETTINGS_CLIENT) == "function"))) {
    var TimeOut = 30

    var _USERSETTINGS_CLIENT = {
        xmlhttpreq: getXmlHttp(),
        jsonResponse: {},
        depth: document.location.toString().match(/\//g).length - 4,
        prefix: function () {
            var strRes = "",
                depth = this.depth

            while (depth --) {
                strRes += "../"
            }

            return strRes
        },

        request: function (jsonReq) {
            jsonReq.rand = Math.random()
            this.xmlhttpreq.open("POST", this.prefix () + "common/usersettings.asp?" + strjson.request(jsonReq), false)
            this.xmlhttpreq.send(null)

            if (this.xmlhttpreq.status == 200)
                jsonRes = JSON.parse(this.xmlhttpreq.responseText)
            else
                ;

            return jsonRes
        },

        GetUserSettings: function (source, parametr) {
            return this.request({ task: "GetUserSettings", "source": source, "parametr": parametr })[parametr]
            //    return GetCookie('UserName');
            //    return "eng6"
        },

        GetServerName: function () {
            //debugger

            var jsonRes = this.request({ task: "server_name" })
            return jsonRes["ServerName"]

            //    return '(local)'
            //    return 'KTS62T'
            //    return '10.105.1.13'
            //    return 'KTS62'
            //    return "PPP"

            //    var net = new ActiveXObject ('WScript.Network')
            //    return net.ComputerName
        },

        GetServerIP: function () {
            //debugger

            var jsonRes = this.request({ task: "server_ip" })
            return jsonRes["ServerIP"]

            //    return '(local)'
            //    return 'KTS62T'
            //    return '10.105.1.13'
            //    return 'KTS62'
            //    return "PPP"

            //    var net = new ActiveXObject ('WScript.Network')
            //    return net.ComputerName
        },

        GetSDDPort: function () {
            return this.request({ task: "sdd_port" })["port"]
        }
    }
}
else ;